<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>																			
<%@ include file="/WEB-INF/view/jsp/base.jsp" %>																																			
<html lang="en">	
<style>

</style>																																										
<body class="wysihtml5-supported">																																							
	<div id="content">																																										
		<div class="container-fluid">																																							
				<table id="" url="" class="mytable" style="margin:15px 0px;">																	
					  <thead>	
						<tr role="row">
							<th class="ui-state-default" role="columnheader" >	
								<div style="font-size:15px;">
									<label class="" style="display:inline;">日志节点地址:&nbsp;</label>																								
									<strong><span style="display:inline;font-size:15px;" class="" id="address" ></span></strong>	
									&nbsp;&nbsp;&nbsp;&nbsp;<label class="" style="display:inline;">状态:&nbsp;</label>																								
									<strong><span style="display:inline;font-size:15px;" class="" id="status" ></span></strong>
									&nbsp;&nbsp;&nbsp;&nbsp;<label class="" style="display:inline;">动作:&nbsp;</label>																								
									<button id="b_stop"  type="button" class="btn btn-mini btn-danger "  style="margin-bottom:5px;padding: 2px 25px;display:none;font-size:15px;" onclick="executeCmd('iblog.sh stop \n')">停&nbsp;&nbsp;止</button>								
						 			<button id="b_start" type="button" class="btn btn-mini btn-success"  readOnly style="margin-bottom:5px;padding: 2px 25px;display:none;font-size:15px;" onclick="executeCmd('iblog.sh start \n')" >启&nbsp;&nbsp;动</button>
								</div>
							</th>
						</tr>
					  </thead>
					  <tbody>
						<tr style="display:none;"><td id="iblog_console"></td></tr>					  
					  </tbody>	
				</table>																																										
		</div>																																													
	</div>																																														
</body>	
<script>																																													
$(document).ready(function(){
	executeCmd("iblog.sh status \n");
})

function executeCmd(cmd){
	$("#b_start").attr("disabled","disabled");
	$("#b_stop").attr("disabled","disabled");	
	$.ajax({
		url:"<%=path%>/sysRunManage/getLogNode",
		data:{"cmd":cmd},
		type:"post",
		success:function(text){
			var data = text.data;
			$("#address").html(data.address);
			$("#status").html(data.status?"启动":"停止");
			$("#iblog_console").html(data.console);
			if(data.status==true){
				$("#b_start").css("display","none");
				$("#b_stop").css("display","inline");
				$("#b_stop").attr("disabled",false);
			}else{
				$("#b_stop").css("display","none");
				$("#b_start").css("display","inline");
				$("#b_start").attr("disabled",false);
			}
		}		
	});
}

</script>																																													
</html>	    																																												

